<meta charset="UTF-8"/>

<script>
   var zfz=prompt("请输入您要反转的字符串：");
   for(var i=zfz.length-1;i>=0;i--){
      document.write(zfz.substring(i,i+1));
  }

</script>